package com.huluobo.a2301mdmdemo

import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import com.huluobo.a2301mdmdemo.pages.ChatPage
import com.huluobo.a2301mdmdemo.pages.ContactPage
import com.huluobo.a2301mdmdemo.pages.CreateGroupPage
import com.huluobo.a2301mdmdemo.pages.GroupListPage
import com.huluobo.a2301mdmdemo.pages.HomePage
import com.huluobo.a2301mdmdemo.pages.MessagePage
import com.huluobo.a2301mdmdemo.video.pages.VideoPage
import com.huluobo.apps.pages.AppsPage
import com.huluobo.document.pages.LocalFilePage
import com.huluobo.lib_base.RoutePath
import com.huluobo.report.pages.ReportCommitPage
import com.huluobo.report.pages.ReportPage
import com.huluobo.sign.pages.SignCommitPage
import com.huluobo.sign.pages.SignListPage
import com.huluobo.user.pages.AddApprovePage
import com.huluobo.user.pages.AddEmployeePage
import com.huluobo.user.pages.ApproveListPage
import com.huluobo.user.pages.ApprovePage
import com.huluobo.user.pages.ComApproveListPage
import com.huluobo.user.pages.ComApprovePage
import com.huluobo.user.pages.LoginPage
import com.huluobo.user.pages.MinePage
import com.huluobo.user.pages.RegisterPage

/**
 *  Created by LC on 2025/6/30.
 */
@Composable
fun MyNavHost(it: PaddingValues, navHostController: NavHostController) {
    NavHost(
        modifier = Modifier.padding(it),
        navController = navHostController,
        startDestination = RoutePath.HOME,
        builder = {
            composable(RoutePath.MESSAGE) { MessagePage(navHostController) }
            composable(RoutePath.HOME) { HomePage(navHostController) }
            composable(RoutePath.MINE) { MinePage(navHostController = navHostController) }
            composable(RoutePath.APPS) { AppsPage(navHostController = navHostController) }
            composable(RoutePath.REPORT) { ReportPage(navHostController = navHostController) }
            composable(RoutePath.REPORT_COMMIT + "/{report}") {
                val report = it.arguments?.getString("report").toString()
                ReportCommitPage(navHostController = navHostController, json = report)
            }
            composable(RoutePath.DOCUMENT) { LocalFilePage(navHostController = navHostController) }
            composable(RoutePath.SIGN_LIST) { SignListPage(navHostController = navHostController) }
            composable(RoutePath.SIGN_COMMIT) { SignCommitPage(navHostController = navHostController) }
            composable(RoutePath.REGISTER) { RegisterPage(navHostController = navHostController) }
            composable(RoutePath.LOGIN) { LoginPage(navHostController = navHostController) }
            composable(RoutePath.ADD_EMPLOYEE) { AddEmployeePage(navHostController = navHostController) }
            composable(RoutePath.ADD_APPROVE) { AddApprovePage(navHostController = navHostController) }
            composable(RoutePath.APPROVE_LIST) { ApproveListPage(navHostController = navHostController) }
            composable(RoutePath.APPROVE + "/{approve}") {
                val approve = it.arguments?.getString("approve").toString()
                ApprovePage(navHostController = navHostController, json = approve)
            }
            composable(RoutePath.COM_APPROVE + "/{approve}") {
                val approve = it.arguments?.getString("approve").toString()
                ComApprovePage(navHostController = navHostController, json = approve)
            }
            composable(RoutePath.COM_APPROVE_LIST) { ComApproveListPage(navHostController = navHostController) }
            composable(RoutePath.VIDEO) { VideoPage(navHostController = navHostController) }
            composable(RoutePath.CONTACT) { ContactPage(navHostController = navHostController) }
            composable(RoutePath.CHAT + "/{chat}") {
                val chat = it.arguments?.getString("chat").toString()
                ChatPage(navHostController = navHostController, json = chat)
            }
            composable(RoutePath.GROUP_LIST) { GroupListPage(navHostController = navHostController) }
            composable(RoutePath.CREATE_GROUP) { CreateGroupPage(navHostController = navHostController) }
        })
}